package goencoding

import "encoding/hex"

// HexEncodeToString encode string to hex string
func HexEncodeToString(src string) string {
	return hex.EncodeToString([]byte(src))
}

// HexDecodeToString decode hex string to string
func HexDecodeToString(dst string) (string, error) {
	decodeString, err := hex.DecodeString(dst)
	if err != nil {
		return "", err
	}
	return string(decodeString), nil
}
